import Vue from 'vue'
Vue.directive('waterMarker',{
    bind(el,bindings){
        let canvs=document.createElement('canvas')
        //设置画布的大小
        canvs.width=250
        canvs.height=150
        //获取画笔的上下文对象
        let cxt=canvs.getContext('2d')
        cxt.rotate((20*Math.PI)/180)
        cxt.fillStyle=bindings.value.color
        cxt.font="48px 宋体"
        cxt.fillText(bindings.value.content,canvs.width/10,canvs.height/2)
        el.appendChild(canvs)
    }
})